package com.starmark.common.auth.config;


import com.starmark.common.auth.interceptor.BaseInterceptor;
import com.starmark.common.auth.interceptor.LoginHandlerInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author starmark
 * @date 20-1-15  下午10:55
 */
@Configuration
public class AuthWebConfig implements WebMvcConfigurer {


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        BaseInterceptor baseInterceptor = new BaseInterceptor();
        baseInterceptor.setNextInterceptor(new LoginHandlerInterceptor());
        registry.addInterceptor(baseInterceptor).addPathPatterns("/**");
    }

}
